﻿@{
    Layout = null;
    var options = new AjaxOptions()
    {
        Url = Url.Action("SaveSocialNetworks", "SiteManagement"),
        UpdateTargetId = "Result",
        OnSuccess = "OnSuccess",
        OnFailure = "OnFailure",
        OnComplete = "OnComplete"
    };
}
@Html.Partial("_MessageBox")

<script type="text/javascript">
    $(document).ready(function () {
        $('#PostIT').click(function () {
            $(this).parents('form').submit();
            return false;
        });
    });

    function OnSuccess(data) {
        ReloadTree();
        OpenPopup('Message', 'Site data successfully saved.', false);
    }

    function OnFailure(data) {
        OpenPopup('Message', 'An error occured during save operation. <br/>Please try again or contact with administrator.', true);
    }

    function OnComplete(data) {
        // code here
    }
</script>

@{Html.EnableClientValidation();}

@using (Ajax.BeginForm(options))
{
    <div style="text-align: left; min-height: 600px; margin-bottom: 20px;">
        <table border="0" cellspacing="0" cellpadding="0" class="advanced-tbl">
            <tr>
                <td colspan="2">
                    <h2>
                        Social Network Settings</h2>
                    <br />
                    <img src="@Url.Content("~/Content/themes/admin/img/general/warning.png")" alt="Warning">
                    Please don't change if you are not sure !<br />
                    <img src="@Url.Content("~/Content/themes/admin/img/general/warning.png")" alt="Warning">
                    Your changes will be appear on <b>Live</b>. There is no draft or etc. version for
                    these properties
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <img src="@Url.Content("~/Content/themes/admin/img/general/sn_facebook.png")" alt="Facebook" />
                </td>
                <td class="lbl">
                    @Html.TextBox(Century.Common.Config.SiteConfigKey.FacebookLink.ToString(), null, new { @class = "big", Value = Century.Globalization.SiteConfigReader.Instance.GetConfig(Century.Common.Config.SiteConfigKey.FacebookLink) })
                </td>
            </tr>
            <tr>
                <td>
                    <img src="@Url.Content("~/Content/themes/admin/img/general/sn_twitter.png")" alt="Twitter" />
                </td>
                <td class="lbl">
                    @Html.TextBox(Century.Common.Config.SiteConfigKey.TwitterLink.ToString(), null, new { @class = "big", Value = Century.Globalization.SiteConfigReader.Instance.GetConfig(Century.Common.Config.SiteConfigKey.TwitterLink) })
                </td>
            </tr>
            <tr>
                <td>
                    <img src="@Url.Content("~/Content/themes/admin/img/general/sn_youtube.png")" alt="Youtube" />
                </td>
                <td class="lbl">
                    @Html.TextBox(Century.Common.Config.SiteConfigKey.YoutubeLink.ToString(), null, new { @class = "big", Value = Century.Globalization.SiteConfigReader.Instance.GetConfig(Century.Common.Config.SiteConfigKey.YoutubeLink) })
                </td>
            </tr>
            <tr>
                <td>
                    <img src="@Url.Content("~/Content/themes/admin/img/general/sn_linkedin.png")" alt="LinkedIn" />
                </td>
                <td class="lbl">
                    @Html.TextBox(Century.Common.Config.SiteConfigKey.LinkedInLink.ToString(), null, new { @class = "big", Value = Century.Globalization.SiteConfigReader.Instance.GetConfig(Century.Common.Config.SiteConfigKey.LinkedInLink) })
                </td>
            </tr>
            <tr>
                <td>
                    <img src="@Url.Content("~/Content/themes/admin/img/general/sn_rss.png")" alt="Rss Feed" />
                </td>
                <td class="lbl">
                    @Html.TextBox(Century.Common.Config.SiteConfigKey.RssFeedLink.ToString(), null, new { @class = "big", Value = Century.Globalization.SiteConfigReader.Instance.GetConfig(Century.Common.Config.SiteConfigKey.RssFeedLink) })
                </td>
            </tr>
            <tr>
                <td>
                    <img src="@Url.Content("~/Content/themes/admin/img/general/sn_vimeo.png")" alt="Vimeo" />
                </td>
                <td class="lbl">
                    @Html.TextBox(Century.Common.Config.SiteConfigKey.VimeoLink.ToString(), null, new { @class = "big", Value = Century.Globalization.SiteConfigReader.Instance.GetConfig(Century.Common.Config.SiteConfigKey.VimeoLink) })
                </td>
            </tr>
            <tr>
                <td>
                    <img src="@Url.Content("~/Content/themes/admin/img/general/sn_rss.png")" alt="Google+" />
                </td>
                <td class="lbl">
                    @Html.TextBox(Century.Common.Config.SiteConfigKey.GooglePlusLink.ToString(), null, new { @class = "big", Value = Century.Globalization.SiteConfigReader.Instance.GetConfig(Century.Common.Config.SiteConfigKey.GooglePlusLink) })
                </td>
            </tr>
            <tr style="height: 100px;">
                <td>
                    &nbsp;
                </td>
                <td class="lbl">
                    <input type="submit" value="Save" class="btn_green btn" />
                </td>
            </tr>
        </table>
    </div>
}